<?php         
$db = new Database;
$auth = Auth::getAuth('current_user');
$user_id = $auth['id'];
$company_id = $auth['company_id'];
?>
                <div class="row-fluid" >
                    <div class="span5" style="padding: 10px;min-height: 430px;">
                        <div class="tabbable"> <!-- Only required for left/right tabs -->
                            <ul class="nav nav-tabs fontTahoma">
                              <li class="formList active form_s"><a href="#tab0" data-toggle="tab">Form List</a></li>
                              <li class="editAddfield form_s"><a href="#tab1" data-toggle="tab">Add Fields</a></li>
                              <li class="editFieldsetting form_s"><a href="#tab2" data-toggle="tab">Field Settings</a></li>
                              <li class="editFormsetting form_s"><a href="#tab3" data-toggle="tab">Form Settings</a></li>
                              <li class="workflowSettings"><a href="#tab4" data-toggle="tab">WorkFlow</a></li>
                              <!--li><a href="#tab4" data-toggle="tab">TBA</a></li-->
                            </ul>
                            <div class="tab-content">
                                <div class="tab-pane active" id="tab0" style="min-height: 420px">
                                    <legend><h5 style="margin-left: 10px;">Form Titles</h5></legend>
                                    <?php
                                    $numrows = $db->query("SELECT * from tbform where company_id='$company_id'","numrows");
                                    $query_forms = $db->query("SELECT * from tbform where company_id='$company_id'","array");
                                    ?>
                                    <table class="table_data">
                                        <thead>
                                            <tr>
                                                <th>#</th>
                                                <th>Form Title</th>
                                                <th>Date</th>
                                                <th>Status</th>
                                                <th colspan="3">Actions</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <?php
                                            if($numrows>0){
                                                foreach($query_forms as $row_forms){
                                            ?>
                                          <tr class="" id="" rel="" title="">
                                            <td><?php echo $row_forms['id']; ?></td>
                                            <td><?php echo $row_forms['form_title']; ?></td>
                                            <td><?php echo $row_forms['date_done']; ?></td>
                                            <td><?php echo status($row_forms['is_active']); ?></td>
                                            <?php
                                            echo statCol($row_forms['is_active'],$row_forms['id'],"forms");
                                            ?>
                                          </tr>
                                          <?php
                                                }
                                            }else{
                                                ?>
                                                <tr><td colspan="7" style="text-align: center">No Form Found</td></tr>
                                                <?php
                                            }
                                          ?>
                                        </tbody>
                                    </table>
                                </div>
                              <div class="tab-pane add_fields" id="tab1">
                                <!--Object to be append-->
                                <h6>No Form is selected </h6>
                              </div>
                              <div class="tab-pane field_settings" id="tab2">
                                <h6>No Object is selected </h6>
                              </div>
                              <div class="tab-pane frm_settings" id="tab3">
                                <h6>No Form is selected </h6>
                              </div>
                              <div class="tab-pane wf_settings" id="tab4" style="min-height: 500px">
                                <h6>No Form is selected </h6>
                              </div>
                            </div>
                        </div>
                    </div>
                        
                    <div class="span7 forForm editFormContent" style="padding: 5px;min-height: 450px; margin-top: 10px;background-color: #FFF; margin-left: 0px; border: 1px solid #ddd;">
                            <!-- Contents here -->
                            <div class="mainContent" id="drag">
                                <br />
                                
                            </div>
                    </div>
                    <div class="main_container" style="display: none;width: 55%;float: right;margin-top: 40px;background-color: #FFF">
                        <span class="actionHolder">
                            <!--img src="/images/flowchart/new_diagram.png" id="terminator-symbol" rel="newDiagram" height="15" width="20" title="New Worflow" class="actionBtn"-->
                            <img src="/images/flowchart/del_node.png" id="delete" rel="delete" height="15" width="20" title="Delete node" class="actionBtn">
                            <img src="/images/flowchart/print_diagram.png" id="printDiagram" rel="print" height="20" width="25" title="Print Diagram" class="actionBtn">
                            <img src="/images/flowchart/zoom_in_diagram.png" id="zoomInDiagram" rel="zIn" height="15" width="20" title="Zoom In" class="actionBtn">
                            <img src="/images/flowchart/zoom_out_diagram.png" id="zoomOutDiagram" rel="zOut" height="15" width="20" title="Zoom Out" class="actionBtn">
                        </span>
                        <div class="flow_content">
                            <!--Start-->
                        </div>
                    </div>
                    <div class="span4 offset7" style="margin-top: 10px;">
                           <!-- Buttons here -->
                           <input type="button" class="btn btn-primary saveEdit_forms" value="Save" />
                    </div>
                </div>
                <script>
                        setActivNav("form_settings");
                </script>